import { Link, useNavigate } from 'react-router-dom'
import { Card, Breadcrumb, Input, message, Modal, Col, Row, Form, Button, Radio, DatePicker, Select, Popconfirm } from 'antd'
//时间组件汉化
import { EditOutlined, EyeInvisibleOutlined, DeleteOutlined } from '@ant-design/icons'
import img404 from '@/assets/error.png'
import React, { useState } from 'react'
import { AdminUserregister, GetAdmuserinfo, EditAdminUser } from '@/apis/adminuser'
import useAdminUserList from '@/hooks/useAdminUserList'
import useAdminPasswd from '@/hooks/useAdminPasswd'

function Password() {
    //修改密码
    const { pasloading , form, handlePasOk } = useAdminPasswd()
    return (<>
        {/* <Modal
            open={pasopen}
            title="修改密码"
            onOk={handlePasOk}
            onCancel={handlePasCancel}
            width={600}
            centered={true}
            footer={[
                <Button type="primary" key="submit" loading={pasloading} onClick={handlePasOk}>
                    修改
                </Button>,
                <Button
                    type="primary"
                    key="close"
                    onClick={handlePasCancel}
                >
                    关闭
                </Button>,
            ]}
        > */}
        <div style={{ padding: "40px", paddingBottom: "5px", width: '60%' }} >
            <Form form={form} onFinish={val => handlePasOk(val)}>
                {/* 传入locale属性 控制中文显示*/}
                {/* <Form.Item label="pasid" name="pasid" hidden={false} >
                    <Input placeholder="" />
                </Form.Item> */}
                <Form.Item label="原密码" name="oldpassword"
                    rules={[
                        {
                            required: true,
                            message: '请输入原密码',
                        },
                    ]}>
                    <Input.Password size="large" placeholder="" />
                </Form.Item>
                <Form.Item label="新密码" name="newpassword"
                    rules={[
                        {
                            required: true,
                            message: '请输入新密码',
                        },
                    ]}>
                    <Input.Password size="large" placeholder="" />
                </Form.Item>
                <Form.Item label="确认密码" name="verifypassword"
                    rules={[
                        {
                            required: true,
                            message: '请输入确认密码',
                        },
                    ]}>
                    <Input.Password size="large" placeholder="" />
                </Form.Item>
                <Form.Item>
                    <Button type="primary" loading={pasloading} htmlType="submit" size="large" block>
                        修改密码
                    </Button>
                </Form.Item>
            </Form>
        </div>
        {/* </Modal> */}
    </>)
}

export default Password